package com.spring.shops.admin.controller.system;

import com.spring.shops.model.result.SysLogResult;
import com.spring.shops.model.vo.SysLogVo;
import com.spring.shops.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sys/log")
public class TzSysLogController {
    @Autowired
    private SysLogService sysLogService;

    @ResponseBody
    @GetMapping("/page")
    public SysLogResult page( @RequestParam("current") String current,
                              @RequestParam("size") String size,
                              @RequestParam(value="username",defaultValue="") String username,
                              @RequestParam(value="operation",defaultValue="") String operation){
        SysLogVo sysLogVo = new SysLogVo();
        sysLogVo.setCurrent(current);
        sysLogVo.setSize(size);
        SysLogVo page = sysLogService.page(sysLogVo, username, operation);
        return SysLogResult.success(page);
    }
}
